package com.example.seckilldemo.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Author Wangbaba
 * @Date 2024/3/18 17:29
 * @Version 1.0
 * 验证数据
 */
public class ValidatorUtils {

    private static final Pattern mobile_pattern=Pattern.compile("[1]([3-9])[0-9]{9}$");

    //手机验证
    public static boolean isMobile(String mobile){
        if (StringUtils.isEmpty(mobile)){
            return false;
        }
       Matcher matcher= mobile_pattern.matcher(mobile);
        return matcher.matches();
    }
}
